﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentData;
/**------------物料检斤----------------------------**/
/**------------利用FluentData2.3版本---------------**/
namespace Jw.Extend
{
    public class tempMateral
    {
        public string goodsName { get; set; }
        public string carCount { get; set; }
        public string recivedWeight { get; set; }
        public string recivedCount { get; set; }
        public string S_FHDWMC { get; set; }
        public string storeName { get; set; }
        public string goodsType { get; set; }
        public string danWei { get; set; }
        public string inType { get; set; }
        public string S_BZ { get; set; }
    }


    //物质检斤报表
    public class MaterialReport
    {
        //
        public List<tempMateral> GetList(string Conn, string goodsName, string goodsType, string carNumber, string supplyName, string inType, string startTime, string endTime)
        {
            // var db = new DbContext().ConnectionString("server=PC201404221248;uid=sa;pwd=123456;database=Jwkj.Weight", DbProviderTypes.SqlServer);
            var db = new DbContext().ConnectionString(Conn, DbProviderTypes.SqlServer);

            var store = db.StoredProcedure("MaterialReport")
                  .ParameterOut("total_count", DataTypes.Int16)
                  .Parameter("goodsName", goodsName)
                  .Parameter("goodsType", goodsType)
                  .Parameter("carNumber", carNumber)
                  .Parameter("storeName", "")
                  .Parameter("inType", inType)
                  .Parameter("supplyName", supplyName)
                  .Parameter("startTime", startTime)
                  .Parameter("endTime", endTime);

            var result = store.Query<tempMateral>();

            return result;
            // var total = store.ParameterValue<int>("total_count");
        }

    }
}
